import { Button, Form, Input } from 'antd';

export default function SearchTop(props:{searchHandler:(ename:string,uname:string)=>void}) {
 const [form] = Form.useForm();

  const onFinish = (values: any) => {
    props.searchHandler(values.ename,values.uname)
  };
  const resetHandler=()=>{
     form.resetFields()
  }

  return (
    <Form form={form} name="horizontal_login" layout="inline" onFinish={onFinish}>
      <Form.Item
        name="ename"
      >
        <Input placeholder="请输入账号信息" />
      </Form.Item>
      <Form.Item
        name="uname"
      >
        <Input  placeholder="请输入姓名信息" />
      </Form.Item>
      <Button type="primary" htmlType="submit">
        搜索一下
      </Button>
       <Button style={{marginLeft:10}} onClick={resetHandler}>重置按钮</Button>
    </Form>
  );
}
